<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>表单</title>
  <link rel="stylesheet" href="${ctx}/static/admin/layui/css/layui.css">
  </head>
  <body>
  	<div class="layui-card-body">
  	<form class="layui-form layui-form-pane">
	  <input name="links.id" type="hidden" value="${item.id! }" />
	  <div class="layui-row">
	    <div class="layui-col-xs6">
	      <div class="layui-form-item">
	        <label class="layui-form-label">模块名称<font style="color: red">*</font></label>
	        <div class="layui-input-block">
		      <input type="text" name="modules.name" lay-verify="required" placeholder="请输入模块名称" autocomplete="off" class="layui-input">
		    </div>
	      </div>
	    </div>
        <div class="layui-col-xs6">
            <div class="layui-form-item">
                <label class="layui-form-label">图标</label>
                <div class="layui-input-block">
                  <input type="text" id="iconPicker" name="modules.iconcls" lay-filter="iconPicker" class="layui-input" style="width: 200px;" value="${item.iconcls!}">
                </div>
            </div>
        </div>
	  </div>
	  <div class="layui-row">
	   <!--
	   <div class="layui-col-xs6">
	      <div class="layui-form-item">
	        <label class="layui-form-label">链接地址<font style="color: red">*</font></label>
	        <div class="layui-input-block">
		      <input type="text" name="modules.url" lay-verify="required" placeholder="请输入链接地址" autocomplete="off" class="layui-input">
		    </div>
	      </div>
	    </div>
	    -->
          <div class="layui-col-xs6">
              <div class="layui-form-item">
                  <label class="layui-form-label">链接地址<font style="color: red">*</font></label>
                  <div class="layui-input-block">
                     <select name="pid" id="pid" lay-filter="pid">
                          <%for(item in sysRes){%>
                          <option value="${item.id}">${item.name}</option>
                          <%}%>
                      </select>
                  </div>
              </div>
          </div>
	    <div class="layui-col-xs6">
	      <div class="layui-form-item" pane="">
	        <label class="layui-form-label">支持附件<font style="color: red">*</font></label>
	        <div class="layui-input-block">
				<input type="radio" name="modules.if_attach" value="0" lay-verify="required" title="否" checked="">
				<input type="radio" name="modules.if_attach" value="1" lay-verify="required" title="是">
		    </div>
	      </div>
	    </div>
	  </div>
	  <div class="layui-row">
	    <div class="layui-col-xs12">
	      <div class="layui-card-header">
	        字段列表&nbsp;&nbsp;&nbsp;&nbsp;<button class="layui-btn layui-btn-sm" id="addColumn" style="top: -5px">新增字段</button>
	      </div>
	      <div class="layui-card-body">
	        <table id="minetable" lay-filter="minetable" class="layui-table" lay-size="sm">
	           <colgroup>
			     <col width="200">
			     <col width="200">
			     <col width="200">
			     <col width="150">
			     <col width="150">
			     <col width="150">
			     <col width="150">
			     <col width="150">
			     <col>
			   </colgroup>
	           <thead>
	             <tr>
	             	<th>字段名称</th>
	             	<th>字段类型</th>
	             	<th>关联表单</th>
	             	<th>关联字段</th>
	             	<th>字段长度</th>
	             	<th>小数点位</th>
	             	<th>默认值</th>
	             	<th>是否可为空</th>
	             	<th>操作</th>
	             </tr>
	           </thead>
	           <tbody id="columnsbodyid">
	             <tr>
	             	<td>
	             	  <input name="column_comment" lay-verify="required" placeholder="请输入字段名称" autocomplete="off" class="layui-input"/>
	             	</td>
	             	<td>
	             	  <select name="column_type" lay-filter="column_type">
	             	    <%for(item in types){%>
					        <option value="${item.value}" ${item.value=='varchar'?'selected'}>${item.name}</option>
					    <%}%>
	             	  </select>
					</td>
					 <td id="foreignTableidTd">
						<select id="foreignTableid" name="foreignTable" lay-filter="foreignTable">
							<option value="">无</option>
						</select>
					 </td>
					 <td>
					    <select id="foreignKeyid" name="foreignKey" lay-filter="foreignKey">
							<option value="">无</option>
						</select>
	             	</td>
	             	<td>
	             	  <input type="number" name="length" lay-verify="" placeholder="请输入字段长度" autocomplete="off" class="layui-input">
	             	</td>
	             	<td>
	             	  <input type="number" name="decimal" lay-verify="" placeholder="请输入小数点位" autocomplete="off" class="layui-input">
	             	</td>
	             	<td>
	             	  <input name="column_default" lay-verify="" placeholder="请输入默认值" autocomplete="off" class="layui-input"/>
	             	</td>
	             	<td>
						<select name="is_nullable">
							<option value="YES" selected>是</option>
							<option value="NO">否</option>
						</select>
	             	</td>
	             	<td>
	             	  &nbsp;&nbsp;
	             	</td>
	             </tr>
	           </tbody>
	         </table>
	      </div>
	    </div>
	  </div>
   	  <div class="layui-form-item" style="display: none">
     	<div class="layui-input-block">
       	  <button id="submit-btn" class="layui-btn" lay-submit >立即提交</button>
          <button id="reset-btn" type="reset" class="layui-btn layui-btn-primary">重置</button>
   	    </div>
   	  </div>
	</form>
	</div>
  </body>
</html>
<script src="${ctx}/static/admin/layui/layui.js"></script>
<script src="${ctx}/static/admin/js/common.js"></script>
<script>
    var ctx = '${ctx}';
    var addoption = '<%for(item in types){%>' +
        '            <option value="${item.value}" ${item.value=="varchar"?"selected"}>${item.name}</option>' +
        '            <%}%>';
</script>
<script src="${ctx}/static/admin/module/modulesForm.js"></script>